home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / Development Tools & Languages / • Other Platforms / PCCTS / h / dlgdef.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-14  |  4.2 KB  |  121 lines  |  [TEXT/MPS ]

  1. /* dlgdef.h
  2.  * Things in scanner produced by dlg that should be visible to the outside
  3.  * world
  4.  *
  5.  * SOFTWARE RIGHTS
  6.  *
  7.  * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
  8.  * Set (PCCTS) -- PCCTS is in the public domain.  An individual or
  9.  * company may do whatever they wish with source code distributed with
  10.  * PCCTS or the code generated by PCCTS, including the incorporation of
  11.  * PCCTS, or its output, into commerical software.
  12.  * 
  13.  * We encourage users to develop software with PCCTS.  However, we do ask
  14.  * that credit is given to us for developing PCCTS.  By "credit",
  15.  * we mean that if you incorporate our source code into one of your
  16.  * programs (commercial product, research project, or otherwise) that you
  17.  * acknowledge this fact somewhere in the documentation, research report,
  18.  * etc...  If you like PCCTS and have developed a nice tool with the
  19.  * output, please mention that you developed it using PCCTS.  In
  20.  * addition, we ask that this header remain intact in our source code.
  21.  * As long as these guidelines are kept, we expect to continue enhancing
  22.  * this system and expect to make other tools available as they are
  23.  * completed.
  24.  *
  25.  * ANTLR 1.23
  26.  * Terence Parr
  27.  * Parr Research Corporation
  28.  * with Purdue University and AHPCRC, University of Minnesota
  29.  * 1989-1994
  30.  */
  31.  
  32. #ifndef ZZDLGDEF_H
  33. #define ZZDLGDEF_H
  34.  
  35. #include "config.h"
  36.  
  37. #ifndef zzchar_t
  38. #ifdef ZZWCHAR_T
  39. #define zzchar_t wchar_t
  40. #else
  41. #define zzchar_t char
  42. #endif
  43. #endif
  44.  
  45. struct zzdlg_state {
  46.     FILE *stream;
  47.     int (*func_ptr)();
  48.     zzchar_t *str;
  49.     int auto_num;
  50.     int add_erase;
  51.     int lookc;
  52.     int char_full;
  53.     int begcol, endcol;
  54.     int line;
  55.     zzchar_t *lextext, *begexpr, *endexpr;
  56.     int bufsize;
  57.     int bufovf;
  58.     zzchar_t *nextpos;
  59.     int    class_num;
  60. };
  61.  
  62. extern zzchar_t    *zzlextext;      /* text of most recently matched token */
  63. extern zzchar_t    *zzbegexpr;    /* beginning of last reg expr recogn. */
  64. extern zzchar_t    *zzendexpr;    /* beginning of last reg expr recogn. */
  65. extern int    zzbufsize;    /* how long zzlextext is */
  66. extern int    zzbegcol;    /* column that first character of token is in*/
  67. extern int    zzendcol;    /* column that last character of token is in */
  68. extern int    zzline;        /* line current token is on */
  69. extern int    zzreal_line;        /* line of 1st portion of token that is not skipped */
  70. extern int    zzchar;        /* character to determine next state */
  71. extern int    zzbufovf;    /* indicates that buffer too small for text */
  72. #ifdef __USE_PROTOS
  73. extern void    (*zzerr)(char *);/* pointer to error reporting function */
  74. #else
  75. extern void    (*zzerr)();
  76. #endif
  77.  
  78. #ifdef __USE_PROTOS
  79. extern void    zzadvance(void);
  80. extern void    zzskip(void);    /* erase zzlextext, look for antoher token */
  81. extern void    zzmore(void);    /* keep zzlextext, look for another token */
  82. extern void    zzmode(int k);    /* switch to automaton 'k' */
  83. extern void    zzrdstream(FILE *);/* what stream to read from */
  84. extern void    zzclose_stream(void);/* close the current input stream */
  85. extern void    zzrdfunc(int (*)());/* what function to get char from */
  86. extern void zzrdstr( zzchar_t * );
  87. extern void    zzgettok(void);    /* get next token */
  88. extern void    zzreplchar(zzchar_t c);/* replace last recognized reg. expr. with
  89.                     a character */
  90. extern void    zzreplstr(zzchar_t *s);/* replace last recognized reg. expr. with
  91.                     a string */
  92. extern void zzsave_dlg_state(struct zzdlg_state *);
  93. extern void zzrestore_dlg_state(struct zzdlg_state *);
  94. extern int zzerr_in(void);
  95. extern void    zzerrstd(char *);
  96. extern void zzerraction();
  97.  
  98. #else
  99.  
  100. extern void    zzadvance();
  101. extern void    zzskip();    /* erase zzlextext, look for antoher token */
  102. extern void    zzmore();    /* keep zzlextext, look for another token */
  103. extern void    zzmode(/*k*/);    /* switch to automaton 'k' */
  104. extern void    zzrdstream();    /* what stream to read from */
  105. extern void    zzclose_stream();/* close the current input stream */
  106. extern void    zzrdfunc();    /* what function to get char from */
  107. extern void zzrdstr();
  108. extern void    zzgettok();    /* get next token */
  109. extern void    zzreplchar();    /* replace last recognized reg. expr. with
  110.                     a character */
  111. extern void    zzreplstr();    /* replace last recognized reg. expr. with
  112.                     a string */
  113. extern void zzsave_dlg_state();
  114. extern void zzrestore_dlg_state();
  115. extern int zzerr_in();
  116. extern void    zzerrstd();
  117. extern void zzerraction();
  118. #endif
  119.  
  120. #endif
  121.